#ifndef __SHOPPINGCART_H_
#define __SHOPPINGCART_H_

#include <string>
#include <iostream>
#include <ctime>
#include "LinkStack.h"
#include "LinkQueue.h"

struct Product
{
    Product(const std::string& name):name(name), price(0.0), purchaseTime(time(0)),deletTime(time(0)){}
    std::string name;  // 商品名称
    double price;  // 商品价格
    time_t purchaseTime;  // 购买时间
    time_t deletTime;  //删除的时间
};

class ShoppingCart  //购物车
{
public:
    ShoppingCart();
    ~ShoppingCart();

    void AddProduct();  //添加商品
    void RemoveProduct();  //删除商品
    void UndoDeletion();  //撤销删除
    void ShowCart();  //显示购物车状态
private:
    LinkQueue Cart;  //购物车队列
    LinkStack Goods;  //回收站商品栈
};

#endif